import React from "react";
import { useHistory } from "react-router";

function Demo() {
  let history =  useHistory();


  let go1 = () => {
    history.push({
      pathname: '/target?id=22222222',
      query: {
        name: '张三',
        age: 100
      },

      state: {
        name: '李四',
        age: 200
      }
    });
  }
   
  return (
    <div>
      <button className="f24" onClick={go1}>go</button> 
    </div>
  );
}

export default Demo;
